import request from '@/utils/request'
export default {
    // 条件分页查询广告列表
    getList(query, current = 1, size = 20){
        return request({
            url:'/article/advertisement/search',
            method:'post',
            data:{...query, current, size}
        })
    },
    // 新增广告
    add(data) {
        return request({
        url:'/article/advertisement',
        method: 'post',
        data // ←注：左边这项相当于ES5中的“data:data”
        })
    },
    // 查询详情
    getById(id){
        return request({
            url:`/article/advertisement/${id}`,
            method:'get'
        })
    },
    // 更新
    update(data){
        return request({
            url:'/article/advertisement',
            method:'put',
            data // ←注：左边这项相当于ES5中的“data:data”
        })
    },
    // 删除广告
    deleteById(id){
        return request({
            url:`/article/advertisement/${id}`,
            method:'delete'
        })
    },
}